//
//  SecondViewController.m
//  UI_Homework_07_01
//
//  Created by 黄威 on 16/5/11.
//  Copyright © 2016年 黄威. All rights reserved.
//

#import "SecondViewController.h"
#import "ThirdViewController.h"
@interface SecondViewController ()

@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self create];


}


- (void)create{


    self.view.backgroundColor = [UIColor blackColor];
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemPlay target:self action:@selector(handleright)];

    UISegmentedControl *segment = [[UISegmentedControl alloc] initWithItems:@[@"第一页",@"第二页"]];
    
//    [segment addTarget:self action:@selector(handleSegment:) forControlEvents:UIControlEventValueChanged];
    
    
    self.navigationItem.titleView = segment;
//    self.navigationItem.titleView

    
    

    

    }


//- (void)handleSegment:(UISegmentedControl *)segment{
//
//    if (segment.selectedSegmentIndex == 0) {
//        
//    }
//
//
//}

- (void)handleright{

    ThirdViewController *third = [[ThirdViewController alloc]init];
    
    
    [self.navigationController pushViewController:third animated:YES];
    

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
